home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / net / netware / xbindry / scanbind.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1995-03-20  |  14.5 KB  |  458 lines

  1. indVesaMode(xsize,ysize,24);
  2.     END;
  3.     IF mode = 0 THEN BEGIN
  4.         WriteLn('No such mode could be found !');
  5.         WriteLn('Switching to to 320x200.');
  6.         ReadKey;
  7.         mode := V320x200x256;
  8.     END;
  9. END;
  10.  
  11. begin { program body }
  12.   SelectMode;
  13.   Initialize;
  14.   ReportStatus;
  15.  
  16. {  AspectRatioPlay; }
  17.   FillEllipsePlay;
  18.   SectorPlay;
  19.   WriteModePlay;
  20.  
  21.   ColorPlay;
  22.   { PalettePlay only intended to work on these drivers: }
  23.   if (GraphDriver = EGA) or
  24.       (GraphDriver = EGA64) or
  25.       (GraphDriver = VGA) then
  26.      PalettePlay;
  27.   PutPixelPlay;
  28. {  PutImagePlay; }
  29.   RandBarPlay;
  30.   BarPlay;
  31.   Bar3DPlay;
  32.   ArcPlay;
  33.   CirclePlay;
  34.   PiePlay;
  35.   LineToPlay;
  36.   LineRelPlay;
  37. {  LineStylePlay; }
  38. {  UserLineStylePlay; }
  39.   TextDump;
  40.   TextPlay;
  41.   CrtModePlay;
  42.   FillStylePlay;
  43.   FillPatternPlay;
  44.   PolyPlay;
  45.   SayGoodbye;
  46. {  CloseGraph; }
  47.   CloseVesa;
  48. end.
  49. ***************************************************
  50.     '* SHOW D2ROTATE (ABOUT THE ORIGIN)
  51.     '****************************************************************∞╥≤c≤*φè#^│v/╒:j═φ0t+l▓ô"¬"g└≡?%ªêΣ│H╫½╫╜├¿U'╒⌐⌡ ßV?╩
  52. ¬ujOΦçEZ1∞▐! ▄B╛Σ8║æ]1GlNÜ┐q▌▓;ô$ΦzE<cª*bEô#ä╧ñÅ"∩─LrdaÖ ╠º╫a^¥£å╬1~)@ëÖMδ╫0═6DäFê¬Çv┼ß╨kæpτ╪É)}ª 1w3╤╧ü⌡¥╓h▓╣≈ïÅaÑ[TⁿHqªÉ╝DKÄ─Y-∞tT╤Θ╨º╟╪.*ÇI9lΦ≈{πτcσ$τπßoFr╪╨∩┼╞╟;O2■e²LÜ4^N|╪½ÅO?╔°FOz`╟╟╟'<>>π$πΘù6·
  53. Xgî╖│°oîδπGƒd╝▀░?■╪╔_9L ⌡ôⁿq'æO▀ƒn4╔▀╚▄┼3pτ.òO°·}÷╕ⁿ±'æO?ít│!√8ßÑ≤/┐╣p┼≥┘E╦Vox╕cΦé5╟╚º╙$?√$≥ΘZεsî≡åìΓpKù¢ïß X╥ 9╞≈\µk┤O¥_ 5Üö\≤éÄ┌╤A[╤ÿáï┼éNⁿÅu16    g,%hc╙╨cD╨Vï┘R¢öKñR;8εáΣ╢╪ós╤π╡á└èxgzPÄMú╫yαºÉ+σJ¢i+▓â3╥    ═Ñ╙î^ºG▓█πérφçs %#(╗⌠?┼%u8≡6+QÉ))ò)Afw≈╣╪)B&4░åLXV:δät@Å.;5Φf╢Ät┐ΣJ╫─U8úÇ╟éö£╕p╔┴⌠vg╨╬╥é÷╪╣┬ΓI.ç≡^v╤ZΦÇ& ╒┌6ñô6XßNè╡╬E₧Ñ
  54. kIº╠▄A+╣╥éb²tæ-Y¡½αÑa═uuîÇ╢αêvhuª╡SÅ┤vèùú¥F;p<d⌐/F─d█éT%▓KΦû=q■öI┐ ┐╠6S$▒÷╚ENΩ¥Fû9╔┌R'╝ ╧φ└?g┬j▓0═/b╖₧─mûé╢┌»ÿÄë/·<éò■░╤╟╢├Xσ:╥P3Θ"╬Læsφ░┌öSö!╗¿*mN£WΣÇ£┤~#╗ææ≥RΩóh:à▌.æ≈╕▌v£äàd▒à╒├=░╖π║$howeg*╬    6ù▄ƒô╕φ░Ö╢qΘD>(w@úKεHÆ╛öúΣU
  55. éÜR╔╤W▄èê 2M%ó.▓SNÖA1ùJE╢║l]▓¿>\%└Å4ßO▄£â⌐& ê/)8vSP▀▓ôⁿææ√ü√ÑÄa⌠â╚4S╓╟P- ?Σá╕▓Næ*q╡UΘ▓≈^ñ·I.rúR&$Y^╚%è≡B┌≈Ceat
  56.     Color := RandColor;
  57.     SetColor(Color);
  58.     SetFillStyle(Random(CloseDotFill)+1, Color);
  59.     Bar3D(Random(MaxWidth), Random(MaxHeight),
  60.           Random(MaxWidth), Random(MaxHeight), 0, TopOff);
  61.   until KeyPressed;
  62.   WaitToGo;
  63. end; { RandBarPlay }
  64.  
  65. procedure ArcPlay;
  66. { Draw random arcs on the screen }
  67. var
  68.   MaxRadius : word;
  69.   EndAngle : word;
  70.   ArcInfo : ArcCoordsType;
  71. begin
  72.   MainWindow('Arc / GetArcCoords demonstration');
  73.   StatusLine('Esc aborts or press a key');
  74.   MaxRadius := MaxY div 10;
  75.   repeat
  76.     SetColor(RandColor);
  77.     EndAngle := Random(360);
  78.     SetLineStyle(SolidLn, 0, NormWidth);
  79.     Arc(Random(MaxX), Random(MaxY), Random(EndAngle), EndAngle, Random(MaxRadius));
  80.     GetArcCoords(ArcInfo);
  81.     with ArcInfo do
  82.     begin
  83.       Line(X, Y, XStart, YStart);
  84.       Line(X, Y, Xend, Yend);
  85.     end;
  86.   until KeyPressed;
  87.   WaitToGo;
  88. end; { ArcPlay }
  89.  
  90. procedure PutPixelPlay;
  91. { Demonstrate the PutPixel and GetPixel commands }
  92. const
  93.   Seed   = 1962; { A seed for the random number generator }
  94.   NumPts = 2000; { The number of pixels plotted }
  95.   Esc    = #27;
  96. var
  97.   I : word;
  98.   X, Y, Color : word;
  99.   XMax, YMax  : integer;
  100.   ViewInfo    : ViewPortType;
  101. begin
  102.   MainWindow('PutPixel / GetPixel demonstration');
  103.   StatusLine('Esc aborts or press a key...');
  104.  
  105.   GetViewSettings(ViewInfo);
  106.   with ViewInfo do
  107.   begin
  108.     XMax := (x2-x1-1);
  109.     YMax := (y2-y1-1);
  110.   end;
  111.  
  112.   while not KeyPressed do
  113.   begin
  114.     { Plot random pixels }
  115.     RandSeed := Seed;
  116.     I := 0;
  117.     while (not KeyPressed) and (I < NumPts) do
  118.     begin
  119.       Inc(I);
  120.         PutPixel(Random(XMax)+1, Random(YMax)+1, RandColor);
  121.     end;
  122.  
  123.     { Erase pixels }
  124.     RandSeed := Seed;
  125.     I := 0;
  126.     while (not KeyPressed) and (I < NumPts) do
  127.     begin
  128.       Inc(I);
  129.       X := Random(XMax)+1;
  130.       Y := Random(YMax)+1;
  131.       Color := GetPixel(X, Y);
  132.         if Color = RandColor then
  133.           PutPixel(X, Y, 0);
  134.      end;
  135.   end;
  136.   WaitToGo;
  137. end; { PutPixelPlay }
  138.  
  139. procedure PutImagePlay;
  140. { Demonstrate the GetImage and PutImage commands }
  141.  
  142. const
  143.   r  = 20;
  144.   StartX = 100;
  145.   StartY = 50;
  146.  
  147. var
  148.   CurPort : ViewPortType;
  149.  
  150. procedure MoveSaucer(var X, Y : integer; Width, Height : integer);
  151. var
  152.   Step : integer;
  153. begin
  154.   Step := Random(2*r);
  155.   if Odd(Step) then
  156.     Step := -Step;
  157.   X := X + Step;
  158.   Step := Random(r);
  159.   if Odd(Step) then
  160.     Step := -Step;
  161.   Y := Y + Step;
  162.  
  163.   { Make saucer bounce off viewport walls }
  164.   with CurPort do
  165.   begin
  166.     if (x1 + X + Width - 1 > x2) then
  167.       X := x2-x1 - Width + 1
  168.     else
  169.       if (X < 0) then
  170.         X := 0;
  171.     if (y1 + Y + Height - 1 > y2) then
  172.       Y := y2-y1 - Height + 1
  173.     else
  174.       if (Y < 0) then
  175.         Y := 0;
  176.   end;
  177. end; { MoveSaucer }
  178.  
  179. var
  180.   Pausetime : word;
  181.   Saucer    : pointer;
  182.   X, Y      : integer;
  183.   ulx, uly  : word;
  184.   lrx, lry  : word;
  185.   Size      : word;
  186.   I         : word;
  187. begin
  188.   ClearDevice;
  189.   FullPort;
  190.  
  191.   { PaintScreen }
  192.   ClearDevice;
  193.   MainWindow('GetImage / PutImage Demonstration');
  194.   StatusLine('Esc aborts or press a key...');
  195.   GetViewSettings(CurPort);
  196.  
  197.   { DrawSaucer }
  198.   Ellipse(StartX, StartY, 0, 360, r, (r div 3)+2);
  199.   Ellipse(StartX, StartY-4, 190, 357, r, r div 3);
  200.   Line(StartX+7, StartY-6, StartX+10, StartY-12);
  201.   Circle(StartX+10, StartY-12, 2);
  202.   Line(StartX-7, StartY-6, StartX-10, StartY-12);
  203.   Circle(StartX-10, StartY-12, 2);
  204.   SetFillStyle(SolidFill, MaxColor);
  205.   FloodFill(StartX+1, StartY+4, GetColor);
  206.  
  207.   { ReadSaucerImage }
  208.   ulx := StartX-(r+1);
  209.   uly := StartY-14;
  210.   lrx := StartX+(r+1);
  211.   lry := StartY+(r div 3)+3;
  212.  
  213.   Size := ImageSize(ulx, uly, lrx, lry);
  214.   GetMem(Saucer, Size);
  215.   GetImage(ulx, uly, lrx, lry, Saucer^);
  216. {  PutImage(ulx, uly, Saucer^, XORput);               { erase image }
  217.  
  218.   { Plot some "stars" }
  219.   for I := 1 to 1000 do
  220.      PutPixel(Random(MaxX), Random(MaxY), RandColor);
  221.   X := MaxX div 2;
  222.   Y := MaxY div 2;
  223.   PauseTime := 70;
  224.  
  225.   { Move the saucer around }
  226.   repeat
  227. {     PutImage(X, Y, Saucer^, XORput);                 { draw image }
  228.      Delay(PauseTime);
  229. {     PutImage(X, Y, Saucer^, XORput);                 { erase image }
  230.      MoveSaucer(X, Y, lrx - ulx + 1, lry - uly + 1);  { width/height }
  231.   until KeyPressed;
  232.   FreeMem(Saucer, size);
  233.   WaitToGo;
  234. end; { PutImagePlay }
  235.  
  236. procedure PolyPlay;
  237. { Draw random polygons with random fill styles on the screen }
  238. const
  239.   MaxPts = 5;
  240. type
  241.   PolygonType = array[1..MaxPts] of PointType;
  242. var
  243.   Poly : PolygonType;
  244.   I, Color : word;
  245. begin
  246.   MainWindow('FillPoly demonstration');
  247.   StatusLine('Esc aborts or press a key...');
  248.   repeat
  249.     Color := RandColor;
  250.     SetFillStyle(Random(11)+1, Color);
  251.     SetColor(Color);
  252.     for I := 1 to MaxPts do
  253.       with Poly[I] do
  254.       begin
  255.         X := Random(MaxX);
  256.         Y := Random(MaxY);
  257.       end;
  258.     FillPoly(MaxPts, Poly);
  259.   until KeyPressed;
  260.   WaitToGo;
  261. end; { PolyPlay }
  262.  
  263. procedure FillStylePlay;
  264. { Display all of the predefined fill styles available }
  265. var
  266.   Style    : word;
  267.   Width    : word;
  268.   Height   : word;
  269.   X, Y     : word;
  270.   I, J     : word;
  271.   ViewInfo : ViewPortType;
  272.  
  273. procedure DrawBox(X, Y : word);
  274. begin
  275.   SetFillStyle(Style, MaxColor);
  276.   with ViewInfo do
  277.     Bar(X, Y, X+Width, Y+Height);
  278.   Rectangle(X, Y, X+Width, Y+Height);
  279.   OutTextXY(X+(Width div 2), Y+Height+4, Int2Str(Style));
  280.   Inc(Style);
  281. end; { DrawBox }
  282.  
  283. begin
  284.   MainWindow('Pre-defined fill styles');
  285.   GetViewSettings(ViewInfo);
  286.   with ViewInfo do
  287.   begin
  288.     Width := 2 * ((x2+1) div 13);
  289.     Height := 2 * ((y2-10) div 10);
  290.   end;
  291.   X := Width div 2;
  292.   Y := Height div 2;
  293.   Style := 0;
  294.   for J := 1 to 3 do
  295.   begin
  296.     for I := 1 to 4 do
  297.     begin
  298.       DrawBox(X, Y);
  299.       Inc(X, (Width div 2) * 3);
  300.     end;
  301.     X := Width div 2;
  302.     Inc(Y, (Height div 2) * 3);
  303.   end;
  304.   SetTextJustify(LeftText, TopText);
  305.   WaitToGo;
  306. end; { FillStylePlay }
  307.  
  308. procedure FillPatternPlay;
  309. { Display some user defined fill patterns }
  310. const
  311.   Patterns : array[0..11] of FillPatternType = (
  312.   ($AA, $55, $AA, $55, $AA, $55, $AA, $55 üÖü üÖü  !BBäx!!!BBäx!BBäx"""DDêp""DDêp>"""BBääêp""!"BDäêêp>IÉÆ|      ° @≥î>00>><Dêx  !BBäx""DDêp&<"DDêê&22TTêêê$> $< @äêp>          ⁿBBBB<  @@Ç****DDDDDDDU¬U¬U¬U¬U¬U¬U¬▌w▌w▌w▌w▌w▌w▌w°°°≥■°°≥≥■≥≥■■°°°    ≤  ≤  ≤≤         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       ;DDD;    $"Bdÿ>@@@>||>Ac]AAA1N"A""2,  `1NA"*III*<Bü üB<<BüüüB<A" \"QIE" < <BBBB  @@    ~ ?  @ÇB$$B ""A$$"AII6 üBr»$**IIII**ccregion.  The region is defined as any pixel of
  313.             OldColor which has a path of pixels of OldColor or NewColor
  314.             with sides touching back to the seed point, (XSeed, YSeed).
  315.             Therefore, only pixels of OldColor are modified and no other
  316.             information is changed.
  317.  
  318.             SEE ALSO
  319.  
  320.             DRWFILLBOX, DRWFILLCIRCLE, DRWFILLELLIPSE, FILLAREA,
  321.             FILLCONVEXPOLY, FILLPAGE, FILLPOLY, FILLSCREEN, FILLVIEW,
  322.             SETVIEW
  323.  
  324.             EXAMPL(HNxHHO$B<BBBB<$<BBBB<<BBBB<$BBBBBF:0BBBBF:$BBBF:B<""AAA""AAAAA"<B@@B<" <2\A">>xDDxDNDD <` <>BB= > <BBBB< BBBBF:2L\bBBBB&AaQIECA8$>""">0@@A>@@@ b$(. b$(*
  325.     $    $    $DDDDDDD¬U¬U¬U¬U¬U¬U¬Uw▌w▌w▌w▌w▌w▌w▌°°°⌠ⁿ°°⌠⌠ⁿ⌠⌠ⁿⁿ°°°    ≈  ≈  ≈≈         °                     ≡≡≡≡≡≡≡≡≡≡≡≡≡≡       7HH7"B\DBBRL~BB@@@@@@?R~!!~?DDDD8BBBB|@@Ç>P>III>"AA""AAA"Uw<DDDD86II6"EIQ"\ @@ "AAAAA> >     hH02L2L$$<H(,$<>>>>>>>         VMODE=VIDEOMODEGET
  326.             IF WHICHVGA = 0 THEN STOP
  327.             DUMMY=RES640
  328.             SETVIEW 100, 100, 539, 379
  329.             FILLVIEW 10
  330.             WHILE INKEY$ = ""
  331.             WEND
  332.             VIDEOMODESET VMODE
  333.             END
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.                                                                          63
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.           FONTGETINFO
  358.  
  359.             PROTOTYPE
  360.  
  361.             SUB FONTGETINFO (Width%, Height%)
  362.  
  363.             INPUT
  364.  
  365.             no input parameters
  366.     WEND
  367.             MOUSEEXIT
  368.             VIDEOMODESET VMODE
  369.             END
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407.  
  408.  
  409.  
  410.                                                                          86
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.           MOUSECURSORDEFAULT
  418.  
  419.             PROTOTYPE
  420.  
  421.             SUB MOUSECURSORDEFAULT ()
  422.  
  423.             INPUT
  424.  
  425.             no input parameters
  426.  
  427.             OUTPUT
  428.  
  429.             no value returned
  430.  
  431.             USAGE
  432.  
  433.             MOUSECURSORDEFAULT defines the mouse cursor to be a small
  434.        ,K$╖┼╘╤░XQ)σ┤ö≡÷┴─┤àñT┘,╘¬àñX9╘⌠àñ\9╘UÜ╢≤`9╘4a╘d9╘UTa╘h9╘ta╘l9╘Uöa╘p9╘┤a╘t┘PT±x┴îÇ╖0▓ïα│ÅαU┤ôα╡ùα╢¢α╖úΓ╘pǺΓ╕¡αë ╚┴πì°sKÉφb<$⌡▌ë     φë φë I1φë  Eφë $YφÆë (mφë ,üφë 0$òφë á⌐φë ñ╜φë I¿╤φë ¼σφë ░∙φÆë 4
  435. ²ë ┤!²ë ╕$5²ë ╝I²ë └]²ë ⌐8q²ë <àⁿΦiǬ∙PÖÇ ¥Ç
  436. ░╨â@%8@ΓΦá╝╤░≡cÑÅ*$
  437. ░╕≡ż≡τ╥m¿⌡ε    ╨@#µ≈$âh$âαra╨à`¥è∩Ç%Ç +─▀ TîcOî∩â°1<@  [$¿Ç¼ MMl·0ƒ Y¼─!%6a▐è ¥ì ßá+?±  P<îaTTV ╪iÇ¡≥░ `_ñ»%Çá᪠P█º»ε`éa∙É%H«┴íA%Gár∙É
  438. iw∙Éiφ`╧≥≡╤Çmⁿ▒
  439. ]ÆAáσw7░⌡∩    $·╟Ç√É&^`  ┐ $ⁿ  $■ $╒ nk$J-ÉQ1£PéBù »0αQ/Ñ4╜£░ºP≈Ñ4Ç⌡$(ª▀$@C]Æé≈└╕_SÇçÑ4=iÉ⌠ä╣<_np@Ñ45ò▒Y3ü¼Qí░.i>╠@5+┴╙É╛╙$@ #┴@«╦
  440. $╤
  441. #@Ñú4,p&e÷ü¼_ÇQºÑ4
  442. òQ  ü@;¡_áQ@e╠≥@mp!┤a╘O░√`Pñź ÇT°8ÿ!¼Åñ$½╙"q¿ PñCÇ¿α√└╥░eT"ß<p°%Pæ(╧%pδ¥/OêW0Ǽbφ φ B@[â¼8â≥µ≤(    ¿⌡%(Ç∩áTÿp+ óÜ▓0!Σ±(1±
  443. ░┤ÖÇD└D0Å╡`   $ «îO@╧1
  444. a╝╤j-0ñ│`@╖bΦaT1═⌠╝╤Σ²¼±,1öíî9lÿ28ÇÅ`Γî¿P²$,N0┴O0a╫δ≤0σú`°î╖#0δ≡└X▄1»Σî(▒¥Ç█Ñ"qá√1CÇú╟╨º Å
  445. FT Θ²î└1ÇY0    w ²à░$@AÅ`╦Φ¼╘`▄1A  }┐Ç*5 ΩSδδî`¼îaδæ¼î5 1¿⌡Ω╜⌠ ¼¥╬ü└Qî1S
  446. ╛≤î9╨iÇ,∙PU(}Ç$üÇ àÇ`σìÇ`QαÜBO$%ÿÇ╧"$Ç«Ç]É.┬\`%WÉ$  W0 ÄâO0]αG┬ur╩
  447. ░£▒
  448. Q¢ú╔Ç≡°s?`X0╘`@ µWâ@╣aá εdq`¥9?Ç&+o0µyÄΣAÅuV(7P╬±@IdQ╕@Å┤@;Ç▓?Çò│CÇ┤╟╨╡KÇÄ30ⁿφ° ó╬ì+]Ä╦≡     Mö╝σ ²y5<!└▀óâ╝É3~mp    $<╛≤9Æ-2ⁿ≡@T,╞Σa,)Pæ└¥#¼╪Q┤S(¼@Aîa
  449. ≡╤@Ö²±⌠KëD─┴▒▀0╨Ñ$╩-0 ╨ê*╙▓edm`î=3Kß-10è=≥≤²└£mîjy ÿe²ⁿ╨i╕e▓ΣmαÖ╢C%Ç*ê*0 EátQZ`mÄLP%    °üⁿªüNQ∙  T¿<qtWΩc z░ÅÇñΩçǪçÇ«;└<┐á¼¥. á?<Σscî)áí := 0;
  450.       end;
  451.     end;
  452.   end;
  453.   WaitToGo;
  454. end; { UserLineStylePlay }
  455.  
  456.  
  457. procedure SayGoodbye;
  458. { Say goodbye and then exit the program }
  459. var
  460.   ViewInfo : ViewPortType;
  461. begin
  462.   MainWindow('');
  463.   GetViewSettings(ViewInfo);
  464.   SetTextStyle(TriplexFont, HorizDir, 4);
  465.   SetTextJustify(CenterText, CenterText);
  466.   with ViewInfo do
  467.     OutTextXY((x2-x1) div 2, (y2-y1) div 2, 'That''s all folks!');
  468.   StatusLine('Press any key to quit...');
  469.   repeat until KeyPressed;
  470. end; { SayGoo